﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.ComponentModel.DataAnnotations;
using AMAP.Domain;

namespace AMAP.Areas.Admin.Models.Account
{
    public class AdminAccountCreateViewModel
    {
        #region User Informations
        [Required]
        [Email]
        [DataType(DataType.EmailAddress)]
        [Display(Name = "E-mail", Prompt = "Adresse e-mail")]
        [MaxLength(100)]
        [Remote("IsEmailAvailable", "Authentication", "Public", ErrorMessage = "Cet adresse e-mail est déjà utilisée")]
        public string Email { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "Mot de passe", Prompt = "Mot de passe")]
        [MaxLength(20)]
        public string Password { get; set; }

        [Compare("Password", ErrorMessage = "Les mots de passe doivent correspondre")]
        [DataType(DataType.Password)]
        [Display(Name = "Confirmation du mot de passe", Prompt = "Confirmation")]
        public string PasswordConfirmation { get; set; }

        [Required]
        [Display(Name = "Nom", Prompt = "Nom de famille")]
        [MaxLength(50)]
        public string LastName { get; set; }

        [Required]
        [Display(Name = "Prénom", Prompt = "Prénom")]
        [MaxLength(50)]
        public string FirstName { get; set; }
        #endregion

        #region Role Informations
        [Required]
        [Display(Name = "Rôle de l'adhérent")]
        public int RoleId { get; set; }

        public IList<Role> RoleList { get; set; }
        public IList<string> Roles { get; set; }
        #endregion

        #region Amap Informations
        [Required]
        [Display(Name = "AMAP de l'adhérent")]
        public int AmapId { get; set; }

        public SelectList AmapList { get; set; }
        #endregion
    }
}